package values.item
{
import framework.dao.EntryUtil;

import values.common.CostValue;

/**
 * ItemUpgradeValue
 * @author jliang
 *
 */
public class ItemUpgradeValue
{
	public var owner:ItemTemplateValue;
	
	[Data(type="field", mapping="@index")]
	public var index:int;
	
	[Data(type="field", mapping="effect")]
	public var effect:*;
	
	[Data(type="field", mapping="requirements")]
	public var requirements:*;
	
	[Data(type="field",  mapping="cost")]
	public var baseCostDef:*;
	
	private var _cost:CostValue;
	
	public function get cost():CostValue
	{
		if (!_cost)
		{
			_cost = EntryUtil.mapping(baseCostDef, CostValue);
			_cost.owner = this;
		}
		return _cost;
	}
}
}